package oop5;

/**
 * @author oldliu
 * @since 1.0
 */
//身份证，姓名
public class Voter {
    private static int count = 0;
    private String name;
    private String id;
    private boolean v = false;//标志是否投过，假定没投过

    public Voter(String name, String id) {
        this.name = name;
        this.id = id;
    }

    public void vote() {
        if (count >= 100) {
            System.out.println("人数已经超过100了，禁止投票");
            return;
        }
        if (v) {
            System.out.println(name + ":您已经投过了，不能再投");
            return;
        }
        System.out.println(name + "来参加投票了，投给谁保密");
        v = true;
        count++;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean isV() {
        return v;
    }

//    public void setV(boolean v) {
//        this.v = v;
//    }
}
